package com.demo.result;


/**
 * @author wangfengchen
 * 枚举了一些常用API操作码
 */
public enum ResultCode implements IErrorCode {

    SUCCESS(200, "请求成功"),
    ERROR(500, "请求失败"),
    BAD_REQUEST(400, "请求参数错误"),
    UNAUTHORIZED(401, "未授权"),
    FORBIDDEN(403, "没有相关权限"),
    NOT_FOUND(404, "请求路径错误"),
    BAD_GATEWAY(502, "网关错误");


    private Integer code;
    private String message;

    ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }


}
